<template>
    <div>
        <div>
            login
        </div>
        <button @click="login">login</button>
    </div>
</template>

<script>

export default {
  data () {
    return {

    }
  },
  methods: {
    login () {
      // 实际上是把数据加密发送到后端校验才对，这里简单模拟
      localStorage.setItem('token', '123456789')
      this.$router.push(this.$route.query.redirect)
    }
  }
}

</script>
